package com.hr.controller.user;

import com.hr.domain.vo.ClientUserInfoVO;
import com.hr.service.UserService;
import com.hr.utils.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/user")
@Tag(name = "用户个人信息")
@AllArgsConstructor
public class ClientUserController {

    private final UserService userService;


    /**
     * 获取用户信息
     * @param id 用户id
     * @return Result
     */
    @GetMapping ("/getUserInfo/{id}")
    @Operation(summary = "获取用户信息")
    public Result getUserInfo( @PathVariable("id") Long id) {
        log.info("获取用户信息");
        ClientUserInfoVO userInfoVO = userService.getUserInfo(id);
        return Result.success(userInfoVO);
    }

}
